﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using System.Collections.ObjectModel;
using CapstoneWinPhone.Data;
using CapstoneWinPhone.ViewModels;

namespace CapstoneWinPhone
{
    public partial class TimeStampViewer : PhoneApplicationPage
    {

        public static WeeklyTimeStamps wts;

        public TimeStampViewer()
        {
            InitializeComponent();
            CreateVisualTimeStamps();
        }

        private void CreateVisualTimeStamps()
        {
            ListOfHoursBox.ItemsSource = DataHolder._currentUser._WeeklyTimeStamps;
        }

        private void ListOfHoursBox_SelectionChanged(Object sender, RoutedEventArgs args)
        {
            if (ListOfHoursBox.SelectedIndex == -1)
                return;

            NavigationService.Navigate(new Uri("/WeeklyTimeStampViewer.xaml?selectedItem=" + ListOfHoursBox.SelectedIndex, UriKind.Relative));

            ListOfHoursBox.SelectedIndex = -1;
        }
    }
}